import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Index',
    meta: {
      title: '首页',
      keepAlive: true,
      requireAuth: true,
    },
    redirect: '/upload',
    component: () => import('@/pages/index.vue'),
    children: [
      {
        path: '/upload',
        name: 'Upload',
        meta: {
          title: '上传',
          keepAlive: true,
          requireAuth: true,
        },
        component: () => import('@/pages/upload.vue'),
      },
      {
        path: '/template',
        name: 'Template',
        meta: {
          title: '模板',
          keepAlive: true,
          requireAuth: true,
        },
        component: () => import('@/pages/template.vue'),
      },
      {
        path: '/parse',
        name: 'Parse',
        meta: {
          title: '解析',
          keepAlive: true,
          requireAuth: true,
        },
        component: () => import('@/pages/temp.vue'),
      },
      {
        path: '/download',
        name: 'Download',
        meta: {
          title: '导出',
          keepAlive: true,
          requireAuth: true,
        },
        component: () => import('@/pages/download.vue'),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});
export default router;
